package test;

import java.util.MissingFormatArgumentException;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import comframe.jdbc.sql.datasource.Config;
import comframe.jdbc.sql.datasource.RayDataSource;
import comframe.jdbc.sql.support.DataType;
import comframe.jdbc.sql.support.GeneralBaseDao;
import comframe.jdbc.sql.support.SqlTemplete;

/**
 * 待识别表数据库操作
 */
public class CarRecordDao extends GeneralBaseDao<CarRecord> {
	public CarRecordDao() {
		Config config = new Config();
		config.setClassName("oracle.jdbc.driver.OracleDriver");
		config.setUrl("jdbc:oracle:thin:@192.168.0.80:1521/orcl");
		config.setUserName("c##JCPT_NEW");
		config.setPassword("JCPT_NEW");
		config.setDataType(DataType.ORACLE);
		config.setAutoCommit(false);
		config.setShowSql(true);
		this.setTemplete(new SqlTemplete(config, true));
	}

	public CarRecordDao(ComboPooledDataSource dataSource) {
		this.setTemplete(new SqlTemplete(new RayDataSource(dataSource, 
				"oacle", true,true)));
	}

	public static void main(String[] args) {
		CarRecordDao dao = new CarRecordDao();
		dao.findByid("id");
	}
}
